package com.web.treatment;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.domain.Treatments;
import com.service.TreatmentsService;
import com.util.AuthenticateHttpServlet;
@WebServlet("/Treatment/PriceEditForm")
public class TreatmentPriceEditForm extends AuthenticateHttpServlet {

	@Override
	protected void post(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		TreatmentsService service = new TreatmentsService();
		Treatments treatment = service.getTreatmentByCode(request.getParameter("code"));
		if (treatment != null) {
			request.setAttribute("treatment", treatment);
			request.getRequestDispatcher("/WEB-INF/jsp/treatmentPriceEdit.jsp").forward(request,
					response);
		}
	}

}
